/*
 * @Author: spark
 * @Date: 2021-06-21 14:08:31
 * @LastEditTime: 2021-06-28 16:01:02
 * @LastEditors: spark
 * @Description: 一个持续与bug做抗争的程序员
 * email: spark.xiaoyu@qq.com
 */
import { RouteRecordRaw } from 'vue-router'
import type { PermissionState } from './state'
import { PermissionsMutationsTypes } from './mutation-types'

export type Mutations<S = PermissionState> = {
    [PermissionsMutationsTypes.MUTATIONS_GET_PERMISSIONS](
        state: S,
        dynamicRoutes: RouteRecordRaw[]
    ): void
}

export const mutations: Mutations = {
    [PermissionsMutationsTypes.MUTATIONS_GET_PERMISSIONS](
        state,
        dynamicRoutes
    ) {
        state.routes = dynamicRoutes
    }
}
